<template>
  <view class="disposeRecord">
    <u-navbar :is-back="true" title="报警处置记录" :title-bold="true" title-color="#000"></u-navbar>
    <view class="u-p-b-30">
      <u-card
        :border="false"
        box-shadow="0px 0px 8px #ddd6d6"
        :body-style="{ padding: '0 0' }"
        :show-head="false"
        :show-foot="false"
      >
        <view slot="body">
          <view class="card-row u-flex-col u-p-t-20 u-p-b-30">
            <u-cell-group :border="false">
              <u-cell-item
                v-for="(item, index) in toUrgeData"
                title-width="150"
                :key="index"
                :title="item.name"
                :border-bottom="false"
                :title-style="{ color: '#333333' }"
                :value-style="{
                  display: 'flex',
                  paddingLeft: '20rpx',
                  textAlign: 'left',
                  color: '#666666',
                }"
                :arrow="false"
                :value="data[item.value]"
              ></u-cell-item>
            </u-cell-group>
          </view>
        </view>
      </u-card>
      <!--    电话信息-->
      <u-card
        :border="false"
        box-shadow="0px 0px 8px #ddd6d6"
        :body-style="{ padding: '0 0' }"
        v-if="showOne"
      >
        <view slot="head">
          <view class="card-row u-flex-col">
            <view class="u-flex">
              <u-line
                color="#014833"
                direction="col"
                :hair-line="false"
                margin="0 20rpx 0 0"
                length="40rpx"
              ></u-line>
              <view class="card-row-title t-green f-bold">电话</view>
            </view>
          </view>
        </view>
        <view slot="body">
          <view class="card-row u-flex-col u-p-t-20 u-p-b-30">
            <u-cell-group :border="false">
              <u-cell-item
                v-for="(item, index) in phoneInfo"
                title-width="170"
                :key="index"
                :title="item.name"
                :border-bottom="false"
                :title-style="{ color: '#333333' }"
                :value-style="{
                  display: 'flex',
                  paddingLeft: '20rpx',
                  textAlign: 'left',
                  color: '#666666',
                }"
                :arrow="false"
                :value="data[item.value]"
              ></u-cell-item>
            </u-cell-group>
          </view>
        </view>
      </u-card>
      <!--    督办意见书-->
      <u-card
        :border="false"
        box-shadow="0px 0px 8px #ddd6d6"
        :body-style="{ padding: '0 0' }"
        v-if="showTwo"
      >
        <view slot="head">
          <view class="card-row u-flex-col">
            <view class="u-flex">
              <u-line
                color="#014833"
                direction="col"
                :hair-line="false"
                margin="0 20rpx 0 0"
                length="40rpx"
              ></u-line>
              <view class="card-row-title t-green f-bold">督办意见书</view>
            </view>
          </view>
        </view>
        <view slot="body">
          <view class="card-row u-flex-col u-p-t-20 u-p-b-30">
            <u-cell-group :border="false">
              <u-cell-item
                v-for="(item, index) in superviseInfo"
                title-width="170"
                :key="index"
                :title="item.name"
                :border-bottom="false"
                :title-style="{ color: '#333333' }"
                :value-style="{
                  display: 'flex',
                  paddingLeft: '20rpx',
                  textAlign: 'left',
                  color: '#666666',
                }"
                :arrow="false"
                :value="data[item.value]"
              ></u-cell-item>
            </u-cell-group>
          </view>
        </view>
      </u-card>
      <!--    预警短信-->
      <u-card
        :border="false"
        box-shadow="0px 0px 8px #ddd6d6"
        :body-style="{ padding: '0 0' }"
        v-if="showThree"
      >
        <view slot="head">
          <view class="card-row u-flex-col">
            <view class="u-flex">
              <u-line
                color="#014833"
                direction="col"
                :hair-line="false"
                margin="0 20rpx 0 0"
                length="40rpx"
              ></u-line>
              <view class="card-row-title t-green f-bold">预警短信</view>
            </view>
          </view>
        </view>
        <view slot="body">
          <view class="card-row u-flex-col u-p-t-20 u-p-b-30">
            <u-cell-group :border="false">
              <u-cell-item
                v-for="(item, index) in noteInfo"
                title-width="170"
                :key="index"
                :title="item.name"
                :border-bottom="false"
                :title-style="{ color: '#333333' }"
                :value-style="{
                  display: 'flex',
                  paddingLeft: '20rpx',
                  textAlign: 'left',
                  color: '#666666',
                }"
                :arrow="false"
                :value="data[item.value]"
              ></u-cell-item>
            </u-cell-group>
          </view>
        </view>
      </u-card>
      <!--    相关领导跟踪调度记录-->
      <u-card
        :border="false"
        box-shadow="0px 0px 8px #ddd6d6"
        :body-style="{ padding: '0 0' }"
        v-if="showFour"
      >
        <view slot="head">
          <view class="card-row u-flex-col">
            <view class="u-flex">
              <u-line
                color="#014833"
                direction="col"
                :hair-line="false"
                margin="0 20rpx 0 0"
                length="40rpx"
              ></u-line>
              <view class="card-row-title t-green f-bold"
                >相关领导跟踪调度记录</view
              >
            </view>
          </view>
        </view>
        <view slot="body">
          <view class="card-row u-flex-col u-p-t-20 u-p-b-30">
            <u-cell-group :border="false">
              <u-cell-item
                v-for="(item, index) in recordInfo"
                title-width="170"
                :key="index"
                :title="item.name"
                :border-bottom="false"
                :title-style="{ color: '#333333' }"
                :value-style="{
                  display: 'flex',
                  paddingLeft: '20rpx',
                  textAlign: 'left',
                  color: '#666666',
                }"
                :arrow="false"
                :value="data[item.value]"
              ></u-cell-item>
            </u-cell-group>
          </view>
        </view>
      </u-card>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      data: {},
      toUrgeData: [
        {
          name: "督促方式",
          value: "pressWay",
        },
        {
          name: "督促时间",
          value: "pressDate",
        },
      ],
      phoneInfo: [
        {
          name: "去电时间",
          value: "calledDate",
        },
        {
          name: "去电人员",
          value: "calledPerson",
        },
        {
          name: "接电话人员",
          value: "calledToPerson",
        },
        {
          name: "报警原因",
          value: "alarmReasonTypeName",
        },
        {
          name: "驻矿员",
          value: "causeStationerName",
        },
        {
          name: "电话简要内容",
          value: "calledContent",
        },
      ],
      superviseInfo: [
        {
          name: "发送人员",
          value: "pressSendPerson",
        },
        {
          name: "接收人员",
          value: "pressAcceptPerson",
        },
        {
          name: "督办意见书编号",
          value: "pressNo",
        },
        {
          name: "督办简要内容",
          value: "pressContent",
        },
      ],
      noteInfo: [
        {
          name: "短信发送时间",
          value: "smsDate",
        },
        {
          name: "短信发送人员",
          value: "smsPerson",
        },
        {
          name: "发送对象",
          value: "smsToPerson",
        },
        {
          name: "发送内容",
          value: "smsContent",
        },
      ],
      recordInfo: [
        {
          name: "调度时间",
          value: "schedulingTime",
        },
        {
          name: "调度人员",
          value: "schedulingPer",
        },
        {
          name: "调度对象",
          value: "schedulingObj",
        },
        {
          name: "调度内容",
          value: "schedulingContent",
        },
      ],
      showOne: false,
      showTwo: false,
      showThree: false,
      showFour: false,
    };
  },
  methods: {},
  onLoad: function (option) {
    this.data = JSON.parse(option.item);
    if (this.data.pressWay) {
      if (this.data.pressWay.indexOf("电话") !== -1) {
        this.showOne = true;
      }
      if (this.data.pressWay.indexOf("督办意见书") !== -1) {
        this.showTwo = true;
      }
      if (this.data.pressWay.indexOf("预警短信") !== -1) {
        this.showThree = true;
      }
      if (this.data.pressWay.indexOf("相关领导跟踪调度记录") !== -1) {
        this.showFour = true;
      }
    }

    const type = option.type
    if (type == '0') {
      // 预警
      this.phoneInfo[3].name = '预警原因'
    }
  },
};
</script>

<style>
</style>
